
#ifndef __I2CMASTERMON_H__
#define __I2CMASTERMON_H__

typedef enum
{
    I2C_CHANNEL_A = 0,
    I2C_CHANNEL_B,
    I2C_CHANNEL_C,
    I2C_CHANNEL_D,
    I2C_CHANNEL_E,
    I2C_CHANNEL_F,
    I2C_CHANNEL_G,
    I2C_CHANNEL_H,
    I2C_CHANNEL_NUMS
}I2C_Channel;

typedef enum
{
    I2C_STATUS_Success = 0,
    I2C_STATUS_NoAck,
    I2C_STATUS_Pending,
    I2C_STATUS_Abort,
    I2C_STATUS_TimeOut,
    I2C_STATUS_UnKnown
}I2C_Status;

typedef struct
{
    I2C_Channel channel;
    I2C_Status stat;
    //unsigned char delay;
    //unsigned char noack_timeout_count;
}I2C_Device;

typedef enum
{
    I2C_MODE_Normal = 0,
    I2C_MODE_SkipStop,
    I2C_MODE_SkipStart,
    I2C_MODE_DataOnly
}I2C_Mode;

extern I2C_Device dev_a;
extern I2C_Device dev_b;
extern I2C_Device dev_c;

void I2CMasterMon_Init(void);
void I2C_master_rw_synchronous(I2C_Device dev, unsigned char addr, unsigned char *pdata, unsigned char length, I2C_Mode mode);

#endif